<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit" />
  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
  <link rel="icon" type="image/png" href="img/app-icon72x72.png" />
  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes" />
  <link rel="icon" sizes="192x192" href="img/app-icon72x72@2x.png" />
  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="apple-mobile-web-app-title" content="标题" />
  <link rel="apple-touch-icon-precomposed" href="img/app-icon72x72@2x.png" />
  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileImage" content="img/app-icon72x72@2x.png" />
  <meta name="msapplication-TileColor" content="#0e90d2" />
  <meta name="viewport" content="width=1200, user-scalable=yes">
  <title>互动直播</title>
  <meta name="description" content="" />
  <meta name="keywords" content="" />
  <!-- /meta -->
  <script
    src="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/pace.min.js"></script>
  <link
    href="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/pace-theme-minimal.min.css"
    rel="stylesheet">
  <!--[if lte IE 9]>
  <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
  <!--[if gt IE 9]><!-->
  <script
    src="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/jquery.3.3.1min.js"></script>
  <!--<![endif]-->
  <!-- /script -->

  <link rel="stylesheet" href="css/main.min.css">

  <!-- /style -->
</head>

<body>

  <div class="page">
    <section class="common_header_item">
      <header class="page__header">

      </header>

      <article class="section page__main_nav">
        <div class="section__wrapper" style="width: 1220px;">
          <div class="column-inner clearfix">
            <nav class="page__nav bar__inner j_follow_bar_nav">
              <li class="nav__item" data-nav="index"><span class="nav__title"><a href="index.html">首页</a></span>
              </li>
              <li class="nav__item" data-nav="news"><span class="nav__title"><a href="news.html">文化资讯</a></span>
              </li>
              <li class="nav__item" data-nav="live"><span class="nav__title"><a href="live.html">互动直播</a></span>
              </li>
              <li class="nav__item" data-nav="ancient"><span class="nav__title"><a
                    href="ancient-culture.html ">古都文化</a></span>
              </li>
              <li class="nav__item" data-nav="activity"><span class="nav__title"><a href="activity.html">活动预约</a></span>
              </li>
              <li class="nav__item" data-nav="venue"><span class="nav__title"><a href="venue.html">场馆预定</a></span>
              </li>
              <li class="nav__item" data-nav="network"><span class="nav__title"><a
                    href="network-train.html">网络培训</a></span>
              </li>
              <li class="nav__item" data-nav="travel"><span class="nav__title"><a
                    href="culture-travel.html">文化旅游</a></span>
              </li>
              <li class="nav__item" data-nav="heritage"><span class="nav__title"><a
                    href="culture-heritage.html ">文化非遗</a></span>
              </li>
              <!-- <li class="nav__item" data-nav="volunteer"><span class="nav__title"><a href="volunteer-event-archive.html">志愿服务</a></span></li> -->
              <!-- <li class="nav__item" data-nav="app"><span class="nav__title"><a href="#">社团管理</a></span></li> -->
              <li class="nav__item" data-nav="county"><span class="nav__title"><a
                    href="county-view.html">区县风采</a></span>
              </li>
              <span class="follow__bar"></span>
            </nav>
          </div>
        </div>
      </article>
    </section>
    <!-- /header -->

    <main class="page__container">
      <!-- / breadcrumb -->
      <!-- banner -->
      <section class="section section__banner_live">
        <div class="section__wrapper">
          <div class="section__container">
            <div class="model model__live_banner">
              <!-- Swiper -->
              <div class="swiper-container">
                <div class="swiper-wrapper ">
                </div>
              </div>
              <!-- Add Arrows -->
              <!-- <div class="swiper-button-next"></div>
              <div class="swiper-button-prev"></div> -->
            </div>
          </div>
        </div>
      </section>
      <!-- 列表内容 -->
      <section class="section">
        <div class="section__wrapper">
          <div class="section__container">
            <div class="module module__media_live media-list" id="lives">
              <!-- 数据渲染 -->
            </div>
          </div>
        </div>
      </section>
      <nav class="page-pagination" aria-label="page-pagination" id="pages">

      </nav>
      <!-- / pagination -->
    </main>
    <!-- / container -->

    <footer class="page__footer">

    </footer>
    <!-- / footer -->

    <!-- / pendant -->
  </div>
  <!-- /page -->



  <script
    src="https://culturetv.hanyastar.com.cn/national_culture_file/pcjs/underscore-min-1.8.3/underscore-min.js"></script>
  <script
    src="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/bowser.min.js"></script>
  <script
    src="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/swiper3.4.2.jquery.min.js"></script>
  <link
    href="https://wenhuabu-media.bj.bcebos.com/front-end-engineer/Intangible-heritage/static/js/xianwenhauyun/swiper3.4.2.min.css"
    rel="stylesheet">
  <script src="https://culturetv.hanyastar.com.cn/national_culture_file/pcjs/layer-3.0.3/layer.min.js"></script>

  <!-- 通用组件 -->
  <script src="js/page-header.js"></script>
  <script src="js/page-footer.js"></script>
  <script src="js/hy.util.js"></script>

  <!-- 前端交互脚本 -->
  <script src="js/common/xtab.js"></script>
  <script src="js/common/xbar.js"></script>
  <script src="js/common/util.js"></script>

  <script src="js/app.js"></script>
  <script src="js/common.min.js"></script>
  <script src="js/common.js"></script>


  <script src="js/common/gb2260.js"></script>
  <script src="js/common/hs-area.js"></script>
  <!-- /script -->

  <script src="js/util/page-helper.js"></script>
  <script>
    $(document).ready(function () {

      var parms = {
        'catId': 100058,
        // 'resType': 'live',
        'order': 1,
        'activityState': null,
        'outputTime': null,
        'collectionId': null,
        'keywords': null,
        'pageSize': 8,//每页条数
        'pageNumber': 1,//页码
      }
      var pageParms = {//根据这个来显示
        'currPage': 1,//当前页码
        'total': 30,//总条数
        'totalPage': 6,//总页码
        'pageSize': 5//每页条数
      }

      initRecommendList(".swiper-wrapper", {
        recommendColumn: "RES_RECOMMEND_COL_32"
      }, function (data) {
        var list = data.data;
        var html = '';
        $(list).each(function (index, item) {
          html += '<div class="swiper-slide">' +
            '<a href="live-detail.html?pubId=' + item.pubId + '" target="_blank">' +
            '<img src="' + item.poster + '" alt="" class="img-responsive">' +
            '<div class="mack">' + item.recommendTitle + '</div>' +
            '<i class="iconfont icon__center">&#xe645;</i>' +
            '<span class="tag">' +
            '<i class="iconfont">&#xe645;</i>' +
            '<i class="iconfont">' + (item.liveState == 1 ? "直播中" : "暂未开播") + '</i>' +
            '<i class="iconfont red">&#xe657;</i>' +
            '</span>' +
            '</a>' +
            '<div class="flag"><span>艺术</span><span>旅游</span></div>' +
            '</div>';
        })
        return html;
      }, function () {

      })

      loadHtml()
      function loadHtml() {
        $.post(urlPath + "api/res/list", parms, function (data) {
          pageParms.currPage = data.currPage;
          pageParms.pageSize = data.pageSize;
          pageParms.totalPage = data.totalPage;
          pageParms.total = data.total;
          page(pageParms, "pages")
          //你要渲染的页面
          var html = '';
          var list = data.data;
          for (var i = 0; i < list.length; i++) {
            var live = list[i];
            var time = live.pubTime.split(' ')
            html += '<div class="pure-u-1-4">' +
              '<div class="column-inner">' +
              '<div class="media media__type_01 media__bdtype_01 media-bg-white media-normal media-card">' +
              '<a class="object" href="live-detail.html?pubId=' + live.pubId + '">' +
              '<img class="" src="' + live.poster + '" width="280" height="170" alt="">' +
              '<i class="iconfont icon__center">&#xe645;</i>' +
              '<span class="tag">' +
              '<i class="iconfont">&#xe645;</i>' +
              '<i class="iconfont">' + (live.res.liveState == 1 ? '直播中' : '暂未开播') + '</i>' +
              '<i class="iconfont red">&#xe657;</i>' +
              '</span>' +
              '</a>' +
              '<div class="caption" >' +
              '<div class="headline">' +
              '<a href="#" target="_blank" class="singleline">' + live.title + '</a>' +
              '</div>' +
              '<div class="abstract">' +
              '<p class="singleline"><span class="flt"><i class="iconfont">&#xe8a9;</i>' + time[0] + '</span>  <span style="' +
              'padding-left: 0px;' +
              'margin-left: 100px;' +
              '"><i class="iconfont " >&#xe7e1;</i>' + live.praiseNum + '</span></p>' +
              '</div>' +
              '</div>' +
              '</div>' +
              '</div>' +
              '</div>';
          }
          $("#lives").html(html);
          ListDate('swiper-wrapper', 'tplSwiper', 8);
        })
      }

      $('#pages').on('click', 'a', function (e) {
        var $this = $(this);
        pageNumber = $this.attr("pageNumber");
        var number = /^[0-9]*$/;
        var newPageNumber;
        if (pageNumber === "page") {
          //更新请求参数
          newPageNumber = number.test($("#page").val()) ? $("#page").val() : pageParms.currPage;
        } else {
          newPageNumber = pageNumber;
        }

        if (newPageNumber != pageParms.currPage) {
          alert(newPageNumber)
          alert(pageParms.currPage)
          parms.pageNumber = newPageNumber;
          loadHtml()
        }
        if ($this.attr('href') === "#") {
          e.preventDefault();
        }
      });

      // ******************************************************
      //模拟ajax
      function ListDate(obj, sql, num) {
        // var tpl = "";
        // for (var i = 0; i < num; i++) {
        //   tpl += $('#' + sql).html();
        // }
        // $('.' + obj).append(tpl);
        // var swiper = new Swiper('.swiper-container', {
        //   nextButton: '.swiper-button-next',
        //   prevButton: '.swiper-button-prev',
        //   autoplay : 3000,
        //   slidesPerView: 1,
        //   loop : true,
        //   autoplayDisableOnInteraction : false,
        //   paginationClickable: true
        // });

        var swiper = new Swiper('.swiper-container', {
          loop: true,
          centeredSlides: true,
          slidesPerView: '2',
          effect: 'coverflow',
          slidesPerGroup: 1,
          autoplay: 3000,
          observer: true,
          observeParents: true,
          coverflow: {
            rotate: 0,//滑动时旋转角度
            stretch: 110,//聚合宽度
            depth: 100,//景深
            modifier: 1,//覆盖叠加层数
            slideShadows: true//是否阴影	
          }
        });
      }



    });
  </script>
</body>

</html>